<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:rg="http://www.ruijie.com.cn/faces/ui"
	xmlns:c="http://java.sun.com/jstl/core"
	template="/layout/contentLayout.xhtml">
	<ui:param name="param_navigationUrl" value="/user/navigationParty.jsf" /> 
	
	<ui:define name="road">
		员工信息
	</ui:define>
	
	<ui:define name="content">
		<!-- 弧形外观 -->
		<h:form id="partyForm">
		<rg:areaPanel  > 
			<rg:areaPanel type="searchPanel" style="margin-top: 10px;">
				<rg:fieldSet column="auto" labelWidth="80px" >
					<rg:inputText id="userName" label="姓名" value="#{partyAction.criteria.userName}" />
					<rg:inputText id="loginName" label="编号" value="#{partyAction.criteria.appUser.username}" />
					
					<h:commandButton styleClass="button" value="查询" />
				</rg:fieldSet>
			</rg:areaPanel>
			
			<div style="margin-top: 10px; text-align: right;">
					<button class="button" onclick="UI.instance.showDialog({id:'addParty', src:'/user/addParty.jsf'});return false;" >
					#{messages.crud_btn_add}
					</button>
			</div>

			<h:panelGroup id="partyTableGroup">
				<rg:table id="partyTable" value="#{partyAction.tableModel}" var="item" >
					<rg:column property="userName" title="姓名" />
					<rg:column property="alias" title="别名" />
					<rg:column property="appUser.username" title="编号"/>
					<rg:column property="appUser.roles" title="角色" converter="#{roleConverter}"/>
					<rg:column property="partyGroup.partyGroupName" title="分组"/>
					<rg:column property="gender" title="性别" converter="#{genderConverter}"/>
					<rg:column property="telephone" title="联系电话" />
					<rg:column property="qq" title="QQ" />
					<rg:column cellType="oper" title="操作" >
						<ul class="links">
							<li>
								<h:outputLink value="#" onclick="UI.instance.showDialog({id:'updateParty', src:'/user/updateParty.jsf?partyId=#{item.id}'});">#{messages.crud_btn_update}</h:outputLink>
							</li>
							<li>
								<h:outputLink value="#" onclick="UI.instance.showDialog({id:'detailParty', src:'/user/detailParty.jsf?partyId=#{item.id}'});">#{messages.crud_btn_detail}</h:outputLink>
							</li>
							<li>
								<a:commandLink value="#{messages.crud_btn_delete}" action="#{partyAction.removeParty(item)}"  
									onclick="if(!confirm('#{messages.crud_del_warn_confirm}')){return;}" reRender="partyTableGroup,globalMessage" />
							</li>
							<li>
								<h:outputLink value="#" onclick="UI.instance.showDialog({id:'updatePartyPassword', src:'/user/updatePartyPassword.jsf?partyId=#{item.id}'});">修改密码</h:outputLink>
							</li>
							<li>
								<a:commandLink value="帐号锁定" action="#{partyAction.disableParty(item)}" 
									rendered="#{item.appUser.enabled}" reRender="partyTableGroup,globalMessage"/>
								<a:commandLink value="帐号解锁" action="#{partyAction.enableParty(item)}" style="color:blue;"
									rendered="#{not item.appUser.enabled}" reRender="partyTableGroup,globalMessage"/>
							</li>
						</ul>
					</rg:column>
				</rg:table>
			</h:panelGroup>
		</rg:areaPanel>
		</h:form>
		<a:form>
			<a:jsFunction name="reRenderPartyTable" reRender="partyTableGroup"/>
		</a:form>
		
	</ui:define>

</ui:composition>